﻿using Shop.Application.Orders.Dto;
using Shop.DB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shop.Application.Orders
{
    public class DeleteOrder
    {
        private DBContext _context;

        public DeleteOrder(DBContext context)
        {
            _context = context;
        }

        public bool Do(Guid id) =>
           _context.Orders.Remove(_context.Orders.FirstOrDefault(x => x.OrderID == id)).IsKeySet;
    }
}
